import os
from mini_torch.core import Variable
from mini_torch.core import Parameter
from mini_torch.core import Function
from mini_torch.core import using_config
from mini_torch.config.core_config import no_grad
from mini_torch.config.core_config import test_mode
from mini_torch.core import as_array
from mini_torch.core import as_variable
from mini_torch.core import setup_variable
from mini_torch.core import Config
from mini_torch.model.layers import Layer
from mini_torch.dataset.datasets import Dataset

import mini_torch.dataset.datasets
import mini_torch.model.optimizers
import mini_torch.function.functions
import mini_torch.function.functions_conv
import mini_torch.model.layers
import mini_torch.utils
import mini_torch.cuda
import mini_torch.dataset.transforms

setup_variable()
__version__ = '0.2.0'


def torch_info():

    current_dir = os.getcwd()
    GREEN = '\033[92m'  # 红色字体
    END = '\033[0m'  # 用于重置所有属性到默认值
    print(GREEN+current_dir+ ":mini_torch:"+__version__+" power by Huterox" + END)
    try:
        import cupy as cp
        device = cp.cuda.Device()
        print(GREEN + current_dir + "当前GPU设备"+device.name + END)
    except ImportError:
        print(GREEN + "当前设备不支持GPU，您可按照文档配置，框架将自动调用-|-" + END)


torch_info()